package my.java.lang;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class ReflectTest {
	
	public static void main(String[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException {
		
		
		Class<ReflectTest> class1 =ReflectTest.class;
		
		Method[] methods = class1.getMethods();
		for (Method method : methods) {
			if(method.getName().equals("say")) {
				method.invoke(class1.newInstance(), null);
			}
		}
	}
	
	
	public void say() {
		System.out.println("a");
	}

}
